
var mongoose = require('mongoose');
  
var NewProductsSchema=new mongoose.Schema({
  Version:{type:Number,required:false},
  AuditData:{CreatedBy:{type:String,required:false} ,LastModifiedBy:{type:String,required:false} ,CreationDate:{type:String,required:false},LastModifiedDate:{type:String,required:false}},
  ASIN:{type:String,required:false},
  UpdateStage:{type:String,required:false},
  //"enum": ["Draft", "ReadyForApproval", "SubmittedForApproval", "InApproval", "Approved","ApprovalRejected", "FeedSubmitted", "FeedRejected", "FeedAccepted"],
  IsDeletedInPTAdmin:{type:Boolean,required:false},
  NeedApproval:{type:Boolean,required:false},
  ListingStatus:{type:String,required:false},
  //"enum": ["Draft", "Active", "Inactive", "Unlisted"],"description": "Draft:未完成铺货, Active:在售, Inactive:已下架, Unlisted:已在亚马逊删除"
  PreviousId:{type:String,required:false},
  ptSellerAccount_StoreId: {type: String,required: false},
  Product: {
    feed_product_type: {
      type: String,
      required: false
    }
  },
 
  ApprovalLog:[{approver:{type:String,required:false},comments:{type:String,required:false},date:{type:String,required:false},isApproved:{type:Boolean,required:false},
  }],
 
 },{collection: 'admNewProduct',timestamps:true});
 
 var ProductTypeDataFieldsSchema=new  mongoose.Schema({
  ProductType:{type:String,required:false},
  GroupList:[{GroupName:{type:String,required:false} ,
    FieldList:[
      {SeqNo:{type:Number,required:false} 
     , FieldName:{type:String,required:false}
     , LocalLableName:{type:String,required:false} 
     , AcceptedValues:{type:String,required:false} 
     , Example:{type:String,required:false} 
     , Required:{type:String,required:false} 
     , ValidValues:[{type:String,required:false}] 
     , FieldType:{type:String,required:false} 
  }] }
  ],

 },{timestamps:true});

mongoose.model('ProductTypeDataFieldsSchema', ProductTypeDataFieldsSchema,'productTypeDataFields');
mongoose.model('NewProductsSchema', NewProductsSchema,'admNewProduct');

  